// -----------------------------------------------------------------------
//  <copyright file="DefaultExceptionHandler.cs" company="LiuliuSoft">
//      Copyright (c) 2022-2024 DaprPlus. All rights reserved.
//  </copyright>
//  <site>https://dapr.plus</site>
//  <last-editor>郭明锋</last-editor>
//  <last-date>2024/12/8 3:02:06</last-date>
// -----------------------------------------------------------------------

namespace DaprPlus.AspNetCore.Mvc.Filters;

/// <summary>
/// 默认异常处理器
/// </summary>
public class DefaultExceptionHandler : ApiResultExceptionHandlerBase
{
    /// <inheritdoc />
    public override int Priority => 9999; // 最低优先级

    /// <inheritdoc />
    public override bool CanHandle(Exception exception)
    {
        return true; // 默认处理器可以处理所有异常
    }

    /// <inheritdoc />
    protected override string GetFriendlyMessage(Exception exception)
    {
        return exception.Message;
    }
}